import query from '@dfeidao/atom-nodejs/db/query';
// import log from '@dfeidao/atom-nodejs/logger/log';
interface Message {
	productid: string;
	client_point_id: string;
}
interface C {
	level_no: string;
}
// interface D {
// 	formid: string;
// }
export default async function atom(msg: Message, action_id: string, session_id: string) {
	const { prepare, exec } = query(action_id, session_id, '12');
	prepare('tenant_level', ['level_no', 'level_name', 'order_num'], { productid: msg.productid }, 20, 1, ['order_num'], []);
	// prepare('pub_form', ['formid', 'formname'], { productid: msg.productid }, 100, 1, [], []);
	const [data] = await exec<C>();
	// const from = new Array();
	// data1.forEach((i) => {
	// 	from.push(i.formid);
	// });
	// prepare('pub_form_code', ['action_keyword', 'action_name', 'code', 'formid'], { productid: msg.productid, formid: { $in: from } }, 200, 1, [], []);
	// const [data2] = await exec<D>();
	// const dd = new Array();
	// data1.forEach((i) => {
	// 	dd.push(i);
	// });
	// data2.forEach((i) => {
	// 	dd.push(i);
	// });
	return { dataArray: data };

}
